package com.murphy.log.service.impl;

import com.murphy.log.bean.Log;
import com.murphy.log.dao.LogMapper;
import com.murphy.log.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("logService")
public class LogServiceImpl  implements LogService {
	
	@Autowired
	private LogMapper logMapper;

	@Override
	public int createLog(Log log) {
        System.out.println("日志添加"+log);
		return logMapper.insert(log);
	}
	
	@Override
	public int updateLog(Log log) {
		System.out.println("日志更新"+log);
		return logMapper.updateLog(log);
	}

    @Override
    public int getLogListCount(Map<String, Object> map) {
        return logMapper.getLogListCount(map);
    }

    @Override
    public List<Log> getLogListPage(Map<String, Object> map,int startRow,int countPerPage) {
	    if(map == null){
	        map = new HashMap<String, Object>();
        }
        map.put("startRow",startRow);
        map.put("count",countPerPage);
        return logMapper.getLogListPage(map);
    }


}
